/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package an_sim;

import java.io.*;
import java.util.Iterator;

/************************************HASZNÁLATON KÍVÜL**********************************
 *
 * @author Karcsi
 */
public class directoryView extends View {

    private String outputRoot;

    public directoryView(FullNetwork fn, String outputroot) {
        super(fn);
        outputRoot = outputroot;
    }

    public void mkDir() {
        boolean status;
        VirtualNetwork root;
        Iterator<VirtualNetwork> vnIt = this.fn.getVirtualNetworkList().iterator();
            while (vnIt.hasNext()) {
                VirtualNetwork temp = vnIt.next();
                if (temp.getGatewayIdUp() == 0) {
                    status=new File("/"+outputRoot+"/"+temp.getSuperNode().getID()+"/").mkdirs();
                    report(status);
                    root=temp;
                }

            }
        }

    static void report(boolean b) {
    System.out.println(b ? "success" : "failure");
  }


    }
